package com.dreamlike.demo.HttpUtil.Core.Validator;

import com.dreamlike.demo.HttpUtil.Core.HttpDefinition;

public interface HttpDefinitionValidator extends Comparable<HttpDefinitionValidator> {

    boolean validate(HttpDefinition httpDefinition, HttpDefinitionValidateResult h);

    default String name(){
        return this.getClass().getName();
    }

    default int order(){
        return Integer.MAX_VALUE;
    }

    @Override
    default int compareTo(HttpDefinitionValidator o){
        return order() - o.order();
    }
}
